package com.example.p2pinvest.common;

import android.app.Application;
import android.content.Context;
import android.os.Handler;

/**
 * @author h2tc01
 * @version 1.0.0
 * 2022/8/3
 */
public class MyApplication extends Application {

    //在整个应用执行过程中需要提供的变量
    public static Context context;  //上下文对象
    public static Handler handler;  //需要使用的handler
    public static Thread mainThread;  //主线程
    public static long mainThreadId;  //主线程id

    @Override
    public void onCreate() {
        super.onCreate();

        context = this.getApplicationContext();
        handler = new Handler();
        mainThread = Thread.currentThread();
        mainThreadId = android.os.Process.myTid();
        //设置未捕获异常的处理器
        //CrashHandler.getInstance().init();
    }
}
